package com.ruoyi.transfers.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.transfers.mapper.WGoodsTransferAccountMapper;
import com.ruoyi.transfers.domain.WGoodsTransferAccount;
import com.ruoyi.transfers.service.IWGoodsTransferAccountService;

/**
 * 货转记账Service业务层处理
 * 
 * @author wzy
 * @date 2024-08-27 15:41:13
 */
@Service
public class WGoodsTransferAccountServiceImpl implements IWGoodsTransferAccountService 
{
    @Autowired
    private WGoodsTransferAccountMapper wGoodsTransferAccountMapper;

    /**
     * 查询货转记账
     * 
     * @param goodsTransferAccountId 货转记账主键
     * @return 货转记账
     */
    @Override
    public WGoodsTransferAccount selectWGoodsTransferAccountByGoodsTransferAccountId(Long goodsTransferAccountId)
    {
        return wGoodsTransferAccountMapper.selectWGoodsTransferAccountByGoodsTransferAccountId(goodsTransferAccountId);
    }

    /**
     * 查询货转记账列表
     * 
     * @param wGoodsTransferAccount 货转记账
     * @return 货转记账
     */
    @Override
    public List<WGoodsTransferAccount> selectWGoodsTransferAccountList(WGoodsTransferAccount wGoodsTransferAccount)
    {
        return wGoodsTransferAccountMapper.selectWGoodsTransferAccountList(wGoodsTransferAccount);
    }

    /**
     * 新增货转记账
     * 
     * @param wGoodsTransferAccount 货转记账
     * @return 结果
     */
    @Override
    public int insertWGoodsTransferAccount(WGoodsTransferAccount wGoodsTransferAccount)
    {
        wGoodsTransferAccount.setCreateTime(DateUtils.getNowDate());
        return wGoodsTransferAccountMapper.insertWGoodsTransferAccount(wGoodsTransferAccount);
    }

    /**
     * 修改货转记账
     * 
     * @param wGoodsTransferAccount 货转记账
     * @return 结果
     */
    @Override
    public int updateWGoodsTransferAccount(WGoodsTransferAccount wGoodsTransferAccount)
    {
        wGoodsTransferAccount.setUpdateTime(DateUtils.getNowDate());
        return wGoodsTransferAccountMapper.updateWGoodsTransferAccount(wGoodsTransferAccount);
    }

    /**
     * 批量删除货转记账
     * 
     * @param goodsTransferAccountIds 需要删除的货转记账主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsTransferAccountByGoodsTransferAccountIds(Long[] goodsTransferAccountIds)
    {
        return wGoodsTransferAccountMapper.deleteWGoodsTransferAccountByGoodsTransferAccountIds(goodsTransferAccountIds);
    }

    /**
     * 删除货转记账信息
     * 
     * @param goodsTransferAccountId 货转记账主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsTransferAccountByGoodsTransferAccountId(Long goodsTransferAccountId)
    {
        return wGoodsTransferAccountMapper.deleteWGoodsTransferAccountByGoodsTransferAccountId(goodsTransferAccountId);
    }

    /**
     * 删除货转记账信息
     *
     * @param goodsTransferAccountNumber 货转记账主键
     * @return 结果
     */
    @Override
    public int deleteWGoodsTransferAccountByGoodsTransferAccountNumber(String goodsTransferAccountNumber)
    {
        return wGoodsTransferAccountMapper.deleteWGoodsTransferAccountByGoodsTransferAccountNumber(goodsTransferAccountNumber);
    }

}
